#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class Meduza(BasicNewsRecipe):
    title = u'Meduza'
    description = u'\u041C\u0435\u0436\u0434\u0443\u043D\u0430\u0440\u043E\u0434\u043D\u043E\u0435 \u0440\u0443\u0441\u0441\u043A\u043E\u044F\u0437\u044B\u0447\u043D\u043E\u0435 \u0438\u0437\u0434\u0430\u043D\u0438\u0435. \u041C\u044B \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u043C \u0434\u043B\u044F \u0432\u0430\u0441 \u0441\u0430\u043C\u044B\u0435 \u0432\u0430\u0436\u043D\u044B\u0435 \u043D\u043E\u0432\u043E\u0441\u0442\u0438 \u0438 \u0433\u043E\u0442\u043E\u0432\u0438\u043C \u043B\u0443\u0447\u0448\u0438\u0435 \u0442\u0435\u043A\u0441\u0442\u044B \u043E \u0442\u043E\u043C, \u0447\u0442\u043E \u043F\u0440\u043E\u0438\u0441\u0445\u043E\u0434\u0438\u0442 \u0432 \u0420\u043E\u0441\u0441\u0438\u0438 \u0438 \u043C\u0438\u0440\u0435.'  # noqa
    __author__ = 'bugmen00t'
    publisher = 'Medusa Project SIA'
    publication_type = 'blog'
    oldest_article = 7
    max_articles_per_feed = 100
    language = 'ru'
    cover_url = 'https://meduza.io/impro/E_cJMv0IQxOC45z-YXeGuzuPB2kQ_A1XsZYrdByOCnk/fill/1200/0/ce/0/aHR0cHM6Ly9tZWR1/emEuaW8vaW1hZ2Uv/YXR0YWNobWVudHMv/aW1hZ2VzLzAwNi83/MTgvODcyL29yaWdp/bmFsLzVPSmRDdWc1/bC1JVG9lTXBqSHFH/ZXcucG5n.png'  # noqa
    auto_cleanup = False
    no_stylesheets = False

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='div', attrs={'class': 'GeneralMaterial-article'})

    remove_tags = [dict(name='div', attrs={'id': 'div-gpt-ad'})]

    feeds = [
        (
            u'\u041D\u043E\u0432\u043E\u0441\u0442\u0438',
            'https://meduza.io/rss2/news'
        ),
        (
            u'\u0418\u0441\u0442\u043E\u0440\u0438\u0438',
            'https://meduza.io/rss2/articles'
        ),
    ]
